package com.junjie.blibli.Sample.strategy;

import com.junjie.blibli.Selector.StorageSelector;
import com.junjie.blibli.util.FastDFSUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class StorageConfiguration {
//    @Bean
//    @Conditional(FastDfsCondition.class)
//    public StorageSelector getFastDfs(){
//        return new FastDFSUtil();
//    }

    @Bean
    @ConditionalOnProperty(value ="storage.select",havingValue="FastDfs",matchIfMissing = true)
    public StorageSelector getFastDfs(){
        return new FastDFSUtil();
    }
}
